#include "OutputDisplay.h"
#include "Stdafx.h"
#include<iostream>   //n
#include<sstream>   //n
#include <vector>   //n
using namespace std;   //n

//DisplayText* OutputDisplay::displayText = new DisplayText;
 
OutputDisplay::OutputDisplay(
                             EventStorage
	//displayText->upcomingText = "meet mum at home at 2pm.";
	//displayText->floatingTasksText = "meet friend on Saturday";
	//displayText->labelText = "added: meet mum at home at 2pm";
}

//DisplayText* OutputDisplay::getDisplayPointer(){
//	return displayText;
//}

string OutputDisplay::converttoString(pos_int index){         //n  
	ostringstream convert;   
	convert << index;     
	return convert.str();
}

//void OutputDisplay::readAllText(DisplayText* displayText,EventVector* _eventList){   //n
void OutputDisplay::readUpcomingText(const Vector<pos_int>& _idList){ 
	string toDisplay;
	pos_int sizeOfIDList = _idList.size();
	for (pos_int i=1; i<=sizeOfIDList; i++){//
        pos_int idDisplayed = _idList.at(i-1);//
        
        
        
        string eventDetails=eventDisplayed.getDetails();//
        //std::cout << i << ". " << eventDetails << std::endl;//
		toDisplay += converttoString(i) + ") " + eventDetails + " " + "\n";//"\r\n";
	 }//
	 
	 //displayText->upcomingText = toDisplay;
	 upcomingText = toDisplay;
	 
}

//void OutputDisplay::showAdded(DisplayText* displayText,Event* anEvent){//n
	//Event currentEvent = (*_historyEvents).back();
//	string display = anEvent->getDetails() + "added successfully" + "\n";
//	displayText->labelText = display;
//}

//void OutputDisplay::showDeleted(DisplayText* displayText){//n
	//Event currentEvent = (*_historyEvents).back();
	//string display = "deleted successfully" + "\n";
	//displayText->labelText = display;
//}

//void OutputDisplay::showEdited(DisplayText* displayText,vector<Event>* _historyEvents){//n
//	Event currentEvent = (*_historyEvents).back();
//	string display = currentEvent.getDetails() + "edited successfully" + "\n";
//	displayText->labelText = display;
//}

//void OutputDisplay::showUndo(DisplayText* displayText,vector<Event>* _historyEvents){//n
//	Event currentEvent = (*_historyEvents).back();
//	string display = currentEvent.getDetails() + "Undo successfully" + "\n";
//	displayText->labelText = display;
//}

string OutputDisplay::getUpcomingText(){
	return upcomingText;
}

//string OutputDisplay::getAllText(){
//	return allText;
//}

//string OutputDisplay::getTodayText(){
//	return todayText;
//}

//string OutputDisplay::getWeekText(){
//	return weekText;
//}

//string OutputDisplay::getFloatingTasksText(){
//	return floatingTasksText;
//}

//string OutputDisplay::getPastOperationsText(){
//	return pastEntriesText;
//}

//string OutputDisplay::getLabelText(){
//	return labelText;
//}

/////string OutputDisplay::showHelp(){//="expected input: help command\n"+"like 'help add' for add format, supporting commands: add, delete, display, edit, undo\n";
/////return helpText;
/////}
/////string OutputDisplay::showHelpAdd(){//="expected input: add content\n"+"add 'generatedindex content' to issues.\n";
/////return helpAdd;
/////}
/////string OutputDisplay::showHelpDelete(){//="expected input: delete index/indices\n"+"display all the 'generatedindex content'\n";
/////return helpDelete;
/////}
/////string OutputDisplay::showHelpDisplay(){//="expected input: display\n"+"add 'generatedindex content' to issues.\n";
/////return helpDisplay;
/////}
/////string OutputDisplay::showHelpModify(){//="expected input: edit indextobeedit new content\n"+"replace the old content at the index with new content\n";
/////return helpModify;
/////}
/////string OutputDisplay::showHelpUndo(){//="expected input: undo\n"+"cancel last command\n";
/////return helpUndo;
/////}
/////string OutputDisplay::showAdded(){//="added successfully\n";
/////return Added;
/////}
/////string OutputDisplay::showDeleted(){//="deleted successfully\n";
/////return Deleted;
/////}
/////string OutputDisplay::showDisplayed(){//="displayed successfully\n";
/////return Displayed;
/////}
/////string OutputDisplay::showModified(){//="added successfully\n";
/////return Modified;
/////}
/////string OutputDisplay::showUndid(){//="undo successfully\n";	
/////return Undid;
/////}
/////string OutputDisplay::showElse(){//="expected input: help command\n"+"like 'help add' for add format, supporting commands: add, delete, display, edit, undo\n";	
/////return helpText;
/////}

//String^ OutputDisplay::convertToSystemString(string toBeConverted){
//	String^ systemString = gcnew String(toBeConverted.c_str());
//	return systemString;
//}

